<%@ page language="java" pageEncoding="utf-8"%>
<%@ page import="java.util.*" %>
<%@ page import="org.jackysoft.query.*" %>
<%@ page import="org.jackysoft.util.*" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<link href="css/apps/equipment/get.css" type="text/css" rel="stylesheet" />
<script src="scripts/apps/equipment/get.js" type="text/javascript"></script>
<%

   Map<String,String> nameMap = new HashMap<String,String>(){
	{
		put("name","名称");
		put("typicalness","型号");
		put("manufacture","生产厂家");
		put("outDate","出厂日期");
		put("outNo","出厂编号");
		put("price","价格");
		put("power","功率");
		put("assetsNo","固定资产编号");
		put("cardNo","卡号");
		put("fundsFrom","购置资金来源令号");
		put("outDepositoryDate","退库日期");
		
	}
	

	    
   };
   
   pageContext.setAttribute("nameMap",nameMap);
 
   pageContext.setAttribute("inOprs",CompareRelation.values());
   
   pageContext.setAttribute("outOprs",LogicRelations.values());   
   
%>

<form action="equipment/equipment!query?page=0&rows=10" method="post" target="queryFrame">

<fieldset>
<legend>设备查询</legend>
<c:set var="gindex" value="0" />
<table class="table table-condensed">
<thead>
  <tr>
    <th>字段名</th>
    <th>对比关系</th>
    <th>字段值</th>
    <th>组合关系</th>
  </tr>
  <tr>
    <th colspan="4">
      <span class="label label-important">注意:</span>  查询涉及到的日期格式应如: 2012-04-18 15:57:14
    </th>
  </tr>
</thead>
<tbody>
  <c:forEach items="${nameMap}" var="name" varStatus="vs">
    
    <input type="hidden" name="query.conditions[${vs.index}].name"  value="${name.key}"/>
  <tr>
  <td>${name.value}</td>
  <td>
    <select class="inopr" name="query.conditions[${vs.index}].inOpr">
       <c:forEach items="${inOprs}" var="iopr">
          <option value="${iopr.name}">${iopr.name}</option>
       </c:forEach>
    </select></td>
  <td><input name="query.conditions[${vs.index}].value" /></td>
  <td>
     <select name="query.conditions[${vs.index}].outOpr">
       <c:forEach items="${outOprs}" var="oopr">
         <option value="${oopr.name}">${oopr.name}</option>
       </c:forEach> 
     </select>  
  </td>
  </tr>
  <c:set var="gindex" value="${vs.index+1}" />
  </c:forEach>
  
  <tr>
     <td>
       <input type="hidden" name="query.conditions[${gindex}].name"  value="owner"/>
           所属单位
     </td>
     <td>
         <select class="inopr" name="query.conditions[${gindex}].inOpr">
       <c:forEach items="${inOprs}" var="iopr">
          <option value="${iopr.name}">${iopr.name}</option>
       </c:forEach>
    </select>  
     
     </td>
     <td>
       <select id="depts" name="query.conditions[${gindex}].value"></select>
     </td>
     <td>
        <select name="query.conditions[${gindex}].outOpr">
         
       <c:forEach items="${outOprs}" var="oopr">
         <option value="${oopr.name}">${oopr.name}</option>
       </c:forEach>
     
     </select>  
     </td>
  </tr>
</tbody>

<tfoot>
  <tr>
    <td colspan="4">
       <button class="btn btn-info" type="button" id="queryBtn">
    <i class="icon-search icon-white"></i>   
       查询</button>
       <button class="btn" type="reset">重置</button>
    </td>
  </tr>
</tfoot>
</table>

</fieldset>
</form>